package com.sihan.swvp.entity.sys;

import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;

import com.sihan.swvp.common.CommonUtil;

public class UserConfig {
	private String skin = "ext-all-green.css";
	private String navwidth = "200";
	
	public UserConfig(){
		
	}
	
	public UserConfig(List<Map<String,Object>> config){
		this.update(config);
	}
	
	public void update(List<Map<String,Object>> config) {
		for (Map<String, Object> map : config) {
			String key = CommonUtil.o2string(map.get("key"));
			String value = CommonUtil.o2string(map.get("value"));
			Method method = CommonUtil.getSetterMethod(this.getClass(),key,String.class);
			if(null != method){
				try {
					method.invoke(this, value);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			
		}
	}
	
	

	public String getSkin() {
		return skin;
	}

	public void setSkin(String skin) {
		this.skin = skin;
	}

	public String getNavwidth() {
		return navwidth;
	}

	public void setNavwidth(String navwidth) {
		this.navwidth = navwidth;
	}

	

}
